// pages/resume/scanComputer/scanComputer.js
Page({
  data: {
    src: "../../../../../image/scan-icon.png",
  },
  onLoad: function (options) {

  },
  onReady: function () {

  },
  scanCode: function () {
    wx.scanCode({
      onlyFromCamera: true,
      success: (res) => {
        this.setData({
          src: "../../../../../image/code-icon.png"
        })
        wx.request({
          url: 'http://106.15.201.147/wx_admin/login',
          method: 'post',
          data: {
            uuid: res.result,
            userId: 'text'
          },
          success: function (res) {
            console.log(res.data);
            if (res.data == "success") {
              wx.showToast({
                title: '成功',
                icon: 'success',
                duration: 2000
              })
            }
          }
        })
      },
      fail: (res) => {
        wx.showToast({
          title: '失败',
          icon: 'success',
          duration: 2000
        })
      },
    })
  }
})